package edu.guet.server.mapper;

import edu.guet.server.model.SemesterStatistic.ChapterScores;
import edu.guet.server.model.dto.HomeworkDTO;
import edu.guet.server.model.vo.HomeworkDetailsVO;
import edu.guet.server.model.vo.HomeworkListVO;
import edu.guet.server.model.vo.SemHmkTestVO;
import edu.guet.server.model.vo.StuTestListVO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface StudentHomeworkMapper {
    /**
     * 获取作业列表
     * @return
     */
    List<HomeworkListVO> getHomeworkList(int stu_id);

    /**
     * 通过id获取作业详情
     * @return
     */
    HomeworkDetailsVO getHomeworkById(int homework_id, int user_id);

    List<ChapterScores.HomeworkScore> findHmkScore(Integer unitId);
    /**
     * 插入作业
     * @param homeworkDTO
     */
    void insertHomework(HomeworkDTO homeworkDTO);

    /**
     * 更新提交作业
     * @param homeworkDTO
     */
    void updateHomework(HomeworkDTO homeworkDTO);

    /**
     * 检查作业是否提交
     * @param homeworkDTO
     * @return
     */
    boolean isHomeworkSubmitted(HomeworkDTO homeworkDTO);

    Double getAverageHmkPerUser(Integer stuId, List<Integer> unitIds);

    List<SemHmkTestVO> getHomeworkListBySemId(int semesterId, int userId);

    HomeworkListVO getHmkStage(int userId, int hmkId);

    StuTestListVO getTestStage(int userId, int testId);
}
